import request from '@/utils/request'

export function getEvaluate(query) {
	return request({
		url: "/api/pms/comment/list",
		method: "POST",
		data: query
	})
}

export function getEvaluateInfo(id) {
	let query = {
		pmsCommentId: id
	};
	return request({
		url: "/api/pms/comment/detail",
		method: "GET",
		params: query
	})
}


export function getServeEvaluateInfo(id) {
	let query = {
		pmsCommentId: id
	};
	return request({
		url: "/api/pms/comment/server/detail",
		method: "GET",
		params: query
	})
}

export function deleteEvaluate(id) {
	return request({
		url: `/api/pms/comment/delete/${id}`,
		method: "GET"
	})
}

export function replayEvaluate(id, msg) {
	let query = {
		content: msg,
		commentId:id
	}
	return request({
		url: `/api/pms/comment/replay`,
		method: "POST",
		data: query
	})
}

export function updateEvaluateStatus(msg) {
	let query = new FormData();
	let arr = msg.ids.toString();
	query.append('ids', arr);
	query.append('showStatus', msg.showStatus)
	return request({
		headers: {
			'content-type': 'multipart/form-data'
		},
		url: `/api/pms/comment/update/showStatus`,
		method: 'POST',
		data: query
	})
}